package com.ruoyi.teacher.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teacher.mapper.TOptionMapper;
import com.ruoyi.teacher.domain.TOption;
import com.ruoyi.teacher.service.ITOptionService;

/**
 * 选项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-01
 */
@Service
public class TOptionServiceImpl implements ITOptionService 
{
    @Autowired
    private TOptionMapper tOptionMapper;

    /**
     * 查询选项
     * 
     * @param id 选项主键
     * @return 选项
     */
    @Override
    public TOption selectTOptionById(Long id)
    {
        return tOptionMapper.selectTOptionById(id);
    }

    /**
     * 查询选项列表
     * 
     * @param tOption 选项
     * @return 选项
     */
    @Override
    public List<TOption> selectTOptionList(TOption tOption)
    {
        return tOptionMapper.selectTOptionList(tOption);
    }

    /**
     * 新增选项
     * 
     * @param tOption 选项
     * @return 结果
     */
    @Override
    public int insertTOption(TOption tOption)
    {
        tOption.setCreateTime(DateUtils.getNowDate());
        return tOptionMapper.insertTOption(tOption);
    }

    /**
     * 修改选项
     * 
     * @param tOption 选项
     * @return 结果
     */
    @Override
    public int updateTOption(TOption tOption)
    {
        tOption.setUpdateTime(DateUtils.getNowDate());
        return tOptionMapper.updateTOption(tOption);
    }

    /**
     * 批量删除选项
     * 
     * @param ids 需要删除的选项主键
     * @return 结果
     */
    @Override
    public int deleteTOptionByIds(Long[] ids)
    {
        return tOptionMapper.deleteTOptionByIds(ids);
    }

    /**
     * 删除选项信息
     * 
     * @param id 选项主键
     * @return 结果
     */
    @Override
    public int deleteTOptionById(Long id)
    {
        return tOptionMapper.deleteTOptionById(id);
    }
}
